/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package BUS;

import DAO.DBConnect;
import com.mysql.jdbc.CallableStatement;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;

/**
 *
 * @author Nobita Chau
 */
public class BUSLoadDL {
    
    public static ResultSet TimTuyen(String sql, int gadi, int gaden, String ngaydi) {
        try {
            Connection conn = DBConnect.Connect();
            java.sql.CallableStatement st = conn.prepareCall(sql);
            st.setInt(1, gadi);
            st.setInt(2, gaden);
            st.setString(3,ngaydi);
            st.execute();
            ResultSet rs = st.getResultSet();
          //  conn.close();
            return rs;

        } catch (Exception ex) {
             System.err.println(ex);
            return null;
        }

    }
    
}
